﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Computer_Manager.BUS;

namespace Computer_Manager.GUI
{
    public partial class frmBackupDB : DevExpress.XtraEditors.XtraForm
    {
        public frmBackupDB()
        {
            InitializeComponent();
        }
        BUS_Backup bus_bak = new BUS_Backup();

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {

            bus_bak.Backup_DB(txtDuongdan.Text);
            XtraMessageBox.Show("Thuc hiện");
        }

        private void btnOpenExcel_Click(object sender, EventArgs e)
        {
            SaveFileDialog mo = new SaveFileDialog();
            mo.Filter = "(*.bak)|*.bak";
            System.Data.DataTable bang = new DataTable();
            if (mo.ShowDialog() == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(mo.FileName))
                {
                    txtDuongdan.Text = mo.FileName;
                    //bus_bak.Backup_DB(mo.FileName);
                }
            }
        }
    }
}